package org.example.aop;

import org.example.aop.controller.Interface1;
import org.example.aop.controller.TextAspectDemo;
import org.example.aop.controller.TextController;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
public class AopApplication {

    public static void main(String[] args) {
        ApplicationContext context = SpringApplication.run(AopApplication.class, args);
        //代理类
        TextAspectDemo bean = context.getBean(TextAspectDemo.class);
        System.out.println(bean);

        //代理接口
        Interface1 interface1 = (Interface1) context.getBean("textController");
        System.out.println(interface1);
    }

}
